package org.kinglone.back.music.service;
import org.kinglone.back.friendlinks.model.Friendlinks;
import org.kinglone.back.music.model.Music;
import org.kinglone.common.dao.impl.BaseDaoImpl;
import org.kinglone.common.util.PageQuery;
import org.kinglone.common.util.PageResults;
import org.kinglone.common.util.StringUtil;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.HashMap;
import java.util.Map;

@Service("musicService")
@Transactional(readOnly=false)
public class MusicServiceImpl extends BaseDaoImpl<Music> implements MusicService {

    @Override
    public PageResults<Music> findMusicByPage(PageQuery pageQuery){
        StringBuffer hql = new StringBuffer("from Music ");
        StringBuffer countsql = new StringBuffer(" select count(0) from music");
        PageResults<Music> pageResults = super.findPageByHqlAndCountSql(hql.toString(),countsql.toString(),pageQuery, null, null);
        return pageResults;
    }
}
